package com.lh.entity.table;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class TreeNode {
    private String title;
    private String key;
    private int count;
    private int level;
    private List<TreeNode> children;

    // 构造方法
    public TreeNode(String title, String key, int level) {
        this.title = title;
        this.key = key;
        this.level = level;
        this.count = 0;
        this.children = new ArrayList<>();
    }

    // getter和setter方法
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }

    // 增加计数的方法
    public void incrementCount() {
        this.count++;
    }
}
